/*
 * @Author: zhangjingyu
 * @Date: 2020-11-20 19:07:44
 * @LastEditors: zhangjingyu
 * @LastEditTime: 2021-03-01 14:35:38
 * @FilePath: \vprisk10.14\src\router\index.js
 * @Description: 
 */
import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/Login/login')
  },
  {
    path: '/',
    name: 'Index',
    component: () => import('@/views/Main'),
    children: [
      {
        path: '404',
        name: '404',
        component: () => import('@/views/Others/404')
      },
      {
        path: 'message',
        name: 'message',
        component: () => import('@/views/Others/notification')
      },
      {
        path: 'home',
        name: 'home',
        component: () => import('@/views/Home/Home')
      },
      /////////////test///////////////
      // 基础指标
      // {
      //   path: 'basicTable',
      //   name: 'basicTable',
      //   component: () => import('@/views/PublicManage/indicator/definitionBasicIndicators/index')
      // },
      // // 口径管理
      // {
      //   path: 'caliber',
      //   name: 'caliber',
      //   component: () => import('@/views/PublicManage/indicator/definitionStatisticalC/index')
      // },
      // // 应用指标
      //  {
      //   path: 'applicationIndexD',
      //   name: 'applicationIndexD',
      //   component: () => import('@/views/PublicManage/indicator/applicationIndexD')
      // },
      // // 数据来源
      // {
      //   path: 'sourceTableDefinition',
      //   name: 'sourceTableDefinition',
      //   component: () => import('@/views/PublicManage/indicator/sourceTableDefinition')
      // },
      // // 维度配置
      // // dimensionConfiguration
      // {
      //   path: 'dimensionConfiguration',
      //   name: 'dimensionConfiguration',
      //   component: () => import('@/views/PublicManage/indicator/dimensionConfiguration')
      // },
      // // 结果查询
      // {
      //   path: 'indexLibraryResultQ',
      //   name: 'indexLibraryResultQ',
      //   component: () => import('@/views/PublicManage/indicator/indexLibraryResultQ')
      // },
      ////////////test////////////////
      // {
      //   /* 工程管理 */
      //   path: 'projectManage',
      //   name: 'projectManage',
      //   component: () => import('@/views/SystemMange/projectManage')
      // },
      // {
      //    /* 租户管理 */
      //    path: 'tenantManage',
      //    name: 'tenantManage',
      //    component: () => import('@/views/SystemMange/tenantManage')
      // },
      //
      // // 流程定义
      // {
      //   path: '/flowDefinition',
      //   name: 'workflow',
      //   component: () => import('@/views/workFlow/flowDefinition/flowDefinition')
      // },
      //  // 代办事宜
      // {
      //   path: '/toDoEvents',
      //   name: 'toDoEvents',
      //   component: () => import('@/views/workFlow/toDoEvents/toDoEvents')
      // },
      // // 已办事宜
      // {
      //   path: '/doneEvents',
      //   name: 'workflow',
      //   component: () => import('@/views/workFlow/doneEvents/doneEvents')
      // },
      // // 流程代理
      // {
      //   path: '/flowAgent',
      //   name: 'flowAgent',
      //   component: () => import('@/views/workFlow/flowAgent/flowAgent')
      // },
      //  // 流程查询
      //  {
      //   path: '/flowQuery',
      //   name: 'flowQuery',
      //   component: () => import('@/views/workFlow/flowQuery/flowQuery')
      // },
      // // 流程监控
      // {
      //   path: '/flowMonitor',
      //   name: 'flowMonitor',
      //   component: () => import('@/views/workFlow/flowMonitor/flowMonitor')
      // },
     

      // 表单开发
      // {
      //   path: '/online/tableInfo/database',
      //   name: 'database',
      //   component: () => import('@/views/formCreate/online/tableInfo/database')
      // },
      // 表单管理
      // {
      //   path: '/online/tableInfo/databaseManage',
      //   name: 'databaseManage',
      //   component: () => import('@/views/formCreate/online/tableInfo/databaseManage')
      
      // },


      // 数据源管理
      // {
      //   path: '/basic/databaseInfo/dataSources',
      //   name: 'databaseInfo',
      //   component: () => import('@/views/formCreate/basic/databaseInfo/dataSources')
      
      // },
      // 代码增强库
      // {
      //   path: '/basic/codeStrong/codeStrong',
      //   name: 'codeStrong',
      //   component: () => import('@/views/formCreate/basic/codeStrong/codeStrong')
      
      // },
      /////////// 内置页面勿删
        {
        path: '/online/table/option',
        name: 'option',
        component: () => import('@/views/formCreate/online/tableInfo/design/designTable'),
      
      },
      {
        path: '/tableInfo/editTable',
        name: "editTable",
        component: () => import('@/views/formCreate/online/tableInfo/design/editTable'),
       
      },
      {
        path: '/template/listPage',
        component: (resolve) => require(['@/views/formCreate/template/listPage'], resolve),
        name: '分页表单'
    
      },
      {
        path: '/form/option',
        // component: Layout,
        component: (resolve) => require(['@/views/formCreate/online/tableInfo/design/option'], resolve),
        name: '表单开发'
    
      },
      /////////// 内置页面勿删
      
      // { /* 维度层级 */
      //   path: 'dimensionHierarchy',
      //   name: 'dimensionHierarchy',
      //   component: () => import('@/views/PublicManage/publicManage/dimensionManage/dimensionHierarchy')
      // },
      // { /* 维度层级 */
      //   path: 'termStructureDefinition',
      //   name: 'termStructureDefinition',
      //   component: () => import('@/views/PublicManage/publicManage/curveManagemen/termStructureDefinition')
      // },
      // {
      //   path: 'dictManage',
      //   name: 'dictManage',
      //   component: () => import('@/views/SystemMange/dictManage')
      // },
      // {// 维度成员
      //   path: 'dimensionMembers',
      //   name: 'dimensionMembers',
      //   label: '维度成员',
      //   component: () => import('@/views/PublicManage/publicManage/dimensionManage/dimensionMembers'),
      // },
      // {// 场景管理
      //   path: 'ruleScene',
      //   name: 'ruleScene',
      //   label: '场景管理',
      //   component: () => import('@/views/caManage/ruleManage/ruleScene/ruleScene'),
      // },
      // {// 运行结果
      //   path: 'ruleResult',
      //   name: 'ruleResult',
      //   label: '运行结果',
      //   component: () => import('@/views/caManage/resultManage/ruleResult/ruleResult'),
      // },
      // {// 运行结果
      //   path: 'ruleVa',
      //   name: 'ruleVa',
      //   label: '规则验证',
      //   component: () => import('@/views/caManage/resultManage/ruleResult/ruleVa'),
      // },
      // {// 分摊动因  caManage/publicManage/sysParms/pubSysParamList
      //   path: 'ruleDriverList',
      //   name: 'ruleDriverList',
      //   label: '费用接受字段',
      //   component: () => import('@/views/caManage/ruleManage/ruleDriver/ruleDriverList'),
      // }
    ]
  }
]
// 处理重复跳转路由报错
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
const router = new VueRouter({
  routes
})

export default router
